﻿@model EagleProject.Models.FormHumanResourceModel

@{
    ViewBag.Title = "CreateHumanResource";
}

<h2>Create Human Resource</h2>

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Create Human Resource</legend>

        <div class="editor-label">
            @Html.LabelFor(m => m.FirstName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(m => m.FirstName)
            @Html.ValidationMessageFor(m => m.FirstName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(m => m.Lastname)
        </div>
        <div class="editor-field">
            @Html.EditorFor(m => m.Lastname)
            @Html.ValidationMessageFor(m => m.Lastname)
        </div>

        <div class="editor-label">
            @Html.LabelFor(m => m.Addresses)
        </div>
        <div class="editor-field">
            @Html.EditorFor(m => m.Addresses)
            @Html.ValidationMessageFor(m => m.Addresses)
        </div>

        <div class="editor-label">
            @Html.LabelFor(m => m.City)
        </div>
        <div class="editor-field">
            @Html.EditorFor(m => m.City)
            @Html.ValidationMessageFor(m => m.City)
        </div>

        <div class="editor-label">
            @Html.LabelFor(m => m.Email)
        </div>
        <div class="editor-field">
            @Html.EditorFor(m => m.Email)
            @Html.ValidationMessageFor(m => m.Email)
        </div>
        <div class="editor-label">
            <label for="StateOrginID">State</label>
        </div>
        <div class="editor-field">
            @Html.DropDownList("StateOrginID", ViewBag.ListState as SelectList, "All", new { id = "StateOrginID" })
        </div>

        <div class="editor-label">
            @Html.LabelFor(m => m.LGAID)
        </div>
        <div class="editor-field">
            @Html.DropDownList("LGAID", ViewBag.ListLGAs as SelectList, "Select Local Gov Area", new { id = "LGAID" })
            @Html.ValidationMessageFor(m => m.LGAID)
        </div>

        <div class="editor-label">
            @Html.LabelFor(m => m.UserName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(m => m.UserName)
            @Html.ValidationMessageFor(m => m.UserName)
        </div>

        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}

<script src="@Url.Content("~/Scripts/jquery-1.7.1.js")"></script>
<script src="@Url.Content("~/DataScript/webApi.js")"></script>
<script>
    @*function registerUpdate(thisid, otherid, emptyString, apiUrl) {*@
    apiUrl = '@Url.Content("~/api/lga/")';
    registerUpdate('StateOrginID', 'LGAID', 'Select Local Gov Area', apiUrl);    
</script>
